<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function Hero(name, type, blood, attack) {
            this.name = name;
            this.type = type;
            this.blood = blood;
            this.attack = attack;
        }
        var lianPo = new Hero('廉颇', '辅助', 500, '近战')
        var houYi = new Hero('后羿', '射手', 100, '远程')

        console.log(lianPo.name);
        console.log(houYi.name);
    </script>
</head>

<body>

</body>

</html>